#ifndef INET_ALARMHANDLER_H
#define INET_ALARMHANDLER_H

#include "SocketStream.h"
#include "Reactor.h"
#include "EventHandler.h"
#include "EventTypes.h"

#include <sstream>
#include <string>
#include <list>
#include <time.h>

struct AlarmEntry
{
  std::string message;
  int prio;
  time_t time;
};


class AlarmHandler : public EventHandler
{
 public:
  AlarmHandler(const SocketStream * stream, Reactor * reactor, std::list<AlarmEntry> * entries);
  void handleEvent (Handle h, EventType et);
  Handle getHandle() const;
  
 private:
  static bool compareEntries(AlarmEntry one, AlarmEntry two);
  const SocketStream * connection_;
  Reactor * reactor_;
  std::list<AlarmEntry> * entries_;

};
#endif


